package com.jumi.microservice.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 额外折扣变更表
 * </p>
 *
 * @author 要挑客户管理团队
 * @since 2020-10-15
 */
@ApiModel(value = "JmExtraDiscountChangeLog对象", description = "额外折扣变更表")
public class JmExtraDiscountChangeLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "会员编号")
    private Integer uid;

    @ApiModelProperty(value = "订单编号")
    private String orderSn;

    @ApiModelProperty(value = "商品id")
    private Integer gid;

    @ApiModelProperty(value = "add,reduce")
    private String discountType;

    @ApiModelProperty(value = "额外金额")
    private BigDecimal discount;

    @ApiModelProperty(value = "添加时间")
    private LocalDateTime addTime;

    @ApiModelProperty(value = "描述")
    private String discountDesc;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public Integer getGid() {
        return gid;
    }

    public void setGid(Integer gid) {
        this.gid = gid;
    }

    public String getDiscountType() {
        return discountType;
    }

    public void setDiscountType(String discountType) {
        this.discountType = discountType;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public LocalDateTime getAddTime() {
        return addTime;
    }

    public void setAddTime(int addTime) {
        Instant instant = Instant.ofEpochSecond(addTime);
        ZoneId zone = ZoneId.systemDefault();
        this.addTime = LocalDateTime.ofInstant(instant, zone);
    }

    public String getDiscountDesc() {
        return discountDesc;
    }

    public void setDiscountDesc(String discountDesc) {
        this.discountDesc = discountDesc;
    }

    @Override
    public String toString() {
        return "JmExtraDiscountChangeLog{" +
                "id=" + id +
                ", uid=" + uid +
                ", orderSn=" + orderSn +
                ", gid=" + gid +
                ", discountType=" + discountType +
                ", discount=" + discount +
                ", addTime=" + addTime +
                ", discountDesc=" + discountDesc +
                "}";
    }
}
